home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWPartng.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.0 KB  |  137 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPartng.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPARTNG_H
  11. #define FWPARTNG_H
  12.  
  13. #ifndef FWPART_H
  14. #include "FWPart.h"
  15. #endif
  16.  
  17. #ifndef FWPROXY_H
  18. #include "FWProxy.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. class FW_MProxy;
  26. class FW_CCloneInfo;
  27. class FW_CProxyFrame;
  28. class FW_CPartProxyFrameIterator;
  29. class FW_CSelection;
  30.  
  31. //========================================================================================
  32. //    class FW_CEmbeddingPart
  33. //========================================================================================
  34.  
  35. class FW_CEmbeddingPart : public FW_CPart
  36. {
  37.     friend class FW_CPartProxyIterator;
  38.  
  39. public:
  40.     FW_DECLARE_CLASS
  41.  
  42. //----------------------------------------------------------------------------------------
  43. //    Initialization/Destruction
  44. //
  45. public:
  46.     FW_CEmbeddingPart(ODPart* odPart, 
  47.                      FW_Instance partInstance,
  48.                     FW_ResourceId partInfoID);
  49.     
  50.     virtual ~FW_CEmbeddingPart();
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    Inherited API
  54. //
  55. public:                                            
  56.     virtual void                ReleaseAll(Environment *ev);
  57.  
  58.     virtual void                LinkStatusChanged(Environment *ev, ODFrame* odFrame);
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    New API
  62. //
  63. public:                                            
  64.     virtual void                EmbeddedFrameRemoved(Environment *ev, 
  65.                                             FW_MProxy* proxy);
  66.                     
  67.     FW_MProxy*                    GetProxy(Environment *ev, ODFrame* embeddedFrame) const;
  68.     
  69. //----------------------------------------------------------------------------------------
  70. //    Internal API (you should never have to called it)
  71. //
  72. public:
  73.     // ----- Cloning -----
  74.     virtual void                PrivCloneInto(Environment *ev,
  75.                                             ODDraftKey key,
  76.                                             ODStorageUnit* toSU,
  77.                                             ODFrame* scope);
  78.  
  79.     // ----- Frame Group/Sequence Number -----
  80.     ODID                        PrivGetNextFrameGroup(Environment *ev);
  81.     void                        PrivSetNextFrameGroup(Environment *ev, ODID frameGroup);
  82.  
  83.     // ----- ProxyFrame list management -----        
  84.     void                         PrivAddProxy(Environment* ev, FW_MProxy* proxy);
  85.     void                         PrivRemoveProxy(Environment* ev, FW_MProxy* proxy);
  86.         
  87.     // ----- Factory -----
  88.     virtual FW_CPresentation*    PrivNewPresentation(Environment *ev, 
  89.                                             FW_CSelection* selection,
  90.                                             ODTypeToken presentationType);
  91.     virtual FW_CDataInterchange* PrivNewDataInterchange(Environment* ev);
  92.  
  93.  
  94. #ifdef FW_BUILD_WIN
  95.     void                        WinAddEmbedMenu(Environment *ev, 
  96.                                             FW_CMenuBar *menuBar);
  97.     ODPart*                        WinCreateEmbeddedPartFromCommand(Environment* ev, 
  98.                                             ODCommandID commandID);
  99.  
  100.     void                         WinEnableEmbedMenu(Environment* ev,
  101.                                             FW_CMenuBar* menuBar);
  102. #endif
  103.  
  104. //----------------------------------------------------------------------------------------
  105. //    Data members
  106. //
  107. private:    
  108.     FW_TOrderedCollection<FW_MProxy>*         fProxys;    
  109.     ODID                        fNextFrameGroup;
  110.  
  111. #ifdef FW_BUILD_WIN
  112.     // This is used by the Windows version to create the embed menu
  113.     FW_CPullDownMenu*            fWinEmbedMenu;
  114.     ODCommandID                    fWinFirstPartID;
  115.     ODCommandID                    fWinLastPartID;
  116.     char                          fTypeString[1024];        // [HLX] need to be dynamic
  117.     char                         *fTypePtr [25];            // [HLX] need to be dynamic
  118. #endif
  119. };
  120.  
  121. //========================================================================================
  122. //    Inlines
  123. //========================================================================================
  124.  
  125. //---------------------------------------------------------------------------------------
  126. //    FW_CEmbeddingPart::PrivGetNextFrameGroup
  127. //----------------------------------------------------------------------------------------
  128. inline ODID FW_CEmbeddingPart::PrivGetNextFrameGroup(Environment*)
  129. {
  130.     return ++fNextFrameGroup;
  131. }
  132.  
  133. #endif
  134.  
  135.  
  136.  
  137.